package com.codi.api.controller;

import com.codi.base.log.annotation.Loggable;
import com.codi.bus.core.resultModel.BaseResult;
import com.codi.bus.core.service.StatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by asus on 2018/2/9.
 */
@Slf4j
@RestController
@RequestMapping("/statistics")
public class StatisticsController {
    @Autowired
    StatisticsService statisticsService;

    @Loggable
    @GetMapping("/tradeConfirm")
    public BaseResult tradeConfirm(int year,int month, int day){
        return statisticsService.getTradeConfirmCount(year,month,day);
    }

    @Loggable
    @GetMapping("/tradeStatistics")
    public BaseResult tradeStatistics(int count){
        return statisticsService.getStatistics(count);
    }

}
